﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using SIN.Client.Model;
using SIN.Client.View;
using SIN.Client.Controller;
using SIN.Client.Resources;

namespace SIN.Client
{
    static class Program
    {
        public static MainFrm mainForm;
        public static MoreInfoFrm moreInfoForm;
        public static webClientModel webClientModel = new webClientModel();
        public static addonInfoModel addonInfoModel = new addonInfoModel();
        public static addonsListModel addonsListModel = new addonsListModel();
        public static addonInfoController aoAddonInfoController = new addonInfoController();
        public static addonsListController aoAddonsListController = new addonsListController();
        /// <summary>
        /// Главная точка входа для приложения.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            mainForm = new MainFrm();
            moreInfoForm = new MoreInfoFrm();
            Application.Run(mainForm);
        }

        public static string MD5(string input)
        {
            System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider();
            byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);
            bs = x.ComputeHash(bs);
            System.Text.StringBuilder s = new System.Text.StringBuilder();
            foreach (byte b in bs) { s.Append(b.ToString("x2").ToLower()); }
            string hash = s.ToString();
            return hash;
        }
    }
}
